var newsTable;
function getServerPointList() {
    if (typeof newsTable !== 'undefined') {
        newsTable.fnPageChange('first');
        return;
    }
    var i = 1;
    newsTable = $("#serverPointList").DataTable({
        "sAjaxSource": _path + "/serverPoint/queryByPage",          
        "fnServerParams": function (aoData) {
            aoData.push(
                {"name": "node" ,"value":$("#node").val()},
                {"name": "area" ,"value":$("#area").val()},
                {"name": "name" ,"value":$("#name").val()}
            );
        },
        "sServerMethod": "POST",
        "sAjaxDataProp": "dataList",
        "fnCreatedRow": function () {
            i++;
        },
        "fnPreDrawCallback": function () {
            i = 1;
        },
        "aoColumns": [
            { "sTitle": "编号", "mData":"id", "sWidth": "2%"},    
            { "sTitle": "分公司", "mData": "node", "sWidth": "10%" },
            { "sTitle": "区域", "mData": "area", "sWidth": "10%" },
            { "sTitle": "邮政场所名称", "mData": "name", "sWidth": "10%" },
            { "sTitle": "地址", "mData": "address", "sWidth": "10%" },
            { "sTitle": "电话", "mData": "tel", "sWidth": "10%" },
            { "sTitle": "邮政编码", "mData": "zipcode", "sWidth": "10%" },
            { "sTitle": "操作", "sWidth": "10%",
                "mData": function (data) {
                    var status = '<a href="' + _path + '/serverPoint/edit/' + data.id + '" class="btn default btn-xs purple"><i class="fa fa-edit" title="编辑"></i></a>&nbsp;';
                    status += '&nbsp;<a href="' + _path + '/serverPoint/del/' + data.id + '"  class="btn default btn-xs red"><i class="fa fa-trash-o" title="删除"></i></a>';
                    return status;
                }
            }
        ]
    });
}
